package com.maomao.maomaochong_i.quanxing.Adpater;

import com.maomao.maomaochong_i.quanxing.Phone;
import com.maomao.maomaochong_i.global.Show;
import com.maomao.maomaochong_i.quanxing.PhoneData.PhoneData;
import com.maomao.maomaochong_i.quanxing.ShanPingShuJu;
import com.maomao.maomaochong_i.quanxing.Xiugai;
import com.maomao.maomaochong_i.quanxing.YingYong;

import java.util.ArrayList;

/**
 * Created by Mrma on 17.5.19.
 */

public class PhoneaccessoriesAdapter implements YingYong,Xiugai {

    private Phone Phone;
    private PhoneData PhoneData;

    private static PhoneaccessoriesAdapter gwc;
    private    ArrayList<ShanPingShuJu> getlist;

    public ArrayList<ShanPingShuJu> getGetlist() {
        return getlist;
    }

    public static PhoneaccessoriesAdapter getOne(Phone Phone){
        if(gwc == null){
            gwc = new PhoneaccessoriesAdapter(Phone);
        }
        return gwc;
    }

    public static PhoneaccessoriesAdapter getOne(){
        return gwc;
    }

    private PhoneaccessoriesAdapter(Phone Phone){
        this.Phone = Phone;
        Phone.tianjia(this);
    }

    @Override
    public void play() {
        PhoneData.classfiy(Show.PHONEACCESSORIES);
        getlist = PhoneData.getList();
    }


    @Override
    public void xiugai(PhoneData PhoneData) {
        this.PhoneData = PhoneData;
        play();
    }
}

